package com.lanou.userLogin.order.service;

import com.lanou.userLogin.order.dao.OrderDao;
import com.lanou.userLogin.order.dao.OrderDaoImpl;
import com.lanou.userLogin.order.domain.Order;
import com.lanou.userLogin.order.domain.OrderBook;
import com.lanou.userLogin.order.domain.OrderItem;
import java.util.List;

public class OrderService {

    private OrderDao od = new OrderDaoImpl();

    public void insertOrder(String oid, String orderTime, double total, String state, String uid, String address) {
        od.insertOrder(oid, orderTime, total, state, uid, address);
    }

    public void insertOrderItem(String iid, int count, String subtotal, String oid, String bid) {
        od.insertOrderItem(iid, count, subtotal, oid, bid);
    }

    public Order selectOrderByoid(String oid) {
        Order order = od.selectOrderByoid(oid);
        return order;
    }

    public List<OrderBook> selectOrderBook(String oid) {
        List<OrderBook> orderBook = od.selectOrderBook(oid);
        return orderBook;
    }

    public void orderPay(String oid, String address){
        od.orderPay(oid, address);
    }

    public List<Order> selectOrder(String uid){
        List<Order> order = od.selectOrder(uid);
        return order;
    }

    public List<OrderItem> selectOrderItem(String oid){
        List<OrderItem> orderItem = od.selectOrderItem(oid);
        return orderItem;
    }

    public void confirmReceipt(String oid,int state){
        od.confirmReceipt(oid,state);
    }
}
